﻿/// <reference path="angular.min.js"/>
/// <reference path="angular-route.js"/>

var MainApp = angular.module("MainApp", ['ngRoute']);
MainApp.config(['$routeProvider'], function ($routeProvider) {
    $routeProvider
        .when('/UserList',
        {
            templateUrl: '/Home/List',
            controller: 'UserListController'
        })
        .when('/UserEdit',
        {
            templateUrl: '/Home/Edit',
            controller: 'UserEditController'
        })
        .when('/UserUpdate',
        {
            templateUrl: '/Home/Update',
            controller: 'UserUpdateController'
        })
        .when('/UserConfig',
        {
            templateUrl: '/Home/Config',
            controller: 'UserConfigController'
        })
        .otherwise({
            redirectTo: '/'
        });
});
MainApp.run([
    '$rootScope', function($rootScope) {

        $rootScope.settings = {};
        $rootScope.settings.location = '#/';
        $rootScope.settings.listUrl = '/Member/GetList';
        $rootScope.settings.AddUrl = '/Member/Add';
        $rootScope.settings.UpdateUrl = '/Member/Update';
        $rootScope.settings.DeleteUrl = '/Member/Delete';
        $rootScope.resttings = function(obj) {
            $rootScope.settings = obj;
        };
    }
]);
MainApp.controller('RootController',
    function ($scope, $http) {
    });
MainApp.controller('UserListController', ['$scope,$http', function($scope, $http) {
    
}]);
window.MainApp = MainApp;
